<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
    <title>图书详情</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    
    <script src="../../scripts/boot.js" type="text/javascript"></script>
    

    <style type="text/css">
    html, body
    {        
        padding:0;
        margin:0;
        border:0;
        height:100%;
        overflow:hidden;
    }

    .asLabel .mini-textbox-border,
    .asLabel .mini-textbox-input,
    .asLabel .mini-buttonedit-border,
    .asLabel .mini-buttonedit-input,
    .asLabel .mini-textboxlist-border
    {
        border:0;background:none;cursor:default;
    }
    .asLabel .mini-buttonedit-button,
    .asLabel .mini-textboxlist-close
    {
        display:none;
    }
    .asLabel .mini-textboxlist-item
    {
        padding-right:8px;
    }    

    </style>
</head>
<body>    
     
    <form id="form1" method="post" >
        <fieldset style="border:solid 1px #aaa;padding:3px;">
            <legend >详情图书信息</legend>
            <div style="padding:5px;">
        <table>
            <tr>
                <td style="width:80px;">图书名称:</td>
                <td style="width:150px;">    
                    <input name="bookname" class="mini-textbox" required="true" requiredErrorText="忘写名字"/>
                </td>
                <td style="width:80px;">出版社：</td>
                <td >                        
                    <input name="publisher" class="mini-textbox" required="true" emptyText="请输入出版社"/>
                        
                </td>
                
            </tr>
            <tr>
                <td >作者：</td>
                <td >    
                    <input name="author" class="mini-textbox" required="true" />
                </td>
                <td >图书类别：</td>
                <td >    
                    <input name="booktype" class="mini-combobox" url="../../data/bookType.txt" 
                    showNullItem="true" nullItemText="请选择类别" allowInput="true"/>
                </td>
            </tr>
            <tr>
                <td >剩余数量：</td>
                <td >    
                    <input name="remain" class="mini-spinner"  minValue="0" maxValue="2147483647" increment=1/>
                </td>
            </tr>          
        </table>            
            </div>
        </fieldset>       
    </form>
    <script type="text/javascript">
        mini.parse();


        var form = new mini.Form("form1");

        //克隆子页面
        function SetData(data) {
                //跨页面传递的数据对象，克隆后才可以安全使用
                data = mini.clone(data);

                $.ajax({
                    url: "/bookinfodetailaction?method=detailBookInfo",
                    data:{data:data.bookid},
                    cache: false,
                    success: function (text) {
                        var o = mini.decode(text);
                        form.setData(o);
                        form.setChanged(false);
                    }
                });
                var fields = form.getFields();                
                for (var i = 0, l = fields.length; i < l; i++) {
                    var c = fields[i];
                    if (c.setReadOnly) c.setReadOnly(true);     //只读
                    if (c.setIsValid) c.setIsValid(true);      //去除错误提示
                    if (c.addCls) c.addCls("asLabel");          //增加asLabel外观
                }
        } 

         function GetData() {
            var o = form.getData();
            return o;
        }
        function CloseWindow(action) {            
            if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
            else window.close();            
        } 
         function onCancel(e) {
            CloseWindow("cancel");
        }
       


    </script>
</body>
</html>